<template>
    <div>
        <Modal v-model="visible" :title="title" width="600" style="position:relative;">
            <Form ref="formData" :model="formData" :label-width="150" >
                <FormItem label="名称" prop="bcck0001">
                    <Input v-model="formData.bcck0001" placeholder="" number style="width: 400px"/>
                </FormItem>
                <FormItem label="校验SQL" prop="bcck0003">
                    <Input v-model="formData.bcck0003" placeholder="" style="width: 400px" type="textarea" :rows="6"/>
                </FormItem>
            </Form>
            <div slot="footer">
                <Button @click="visible = false">关闭</Button>
            </div>
        </Modal>
        <Modal v-model="modalResult" :title=titleResult width="800" height="600" cancel-text="关闭" >
            <vxe-table border
                       resizable
                       row-id="id"
                       :row-key="true"
                       show-overflow="tooltip"
                       align="center"
                       header-align="center"
                       ref="xTree"
                       :loading="Loading"
                       :radio-config="{highlight: true}"
                       class="mytable-style"
                       :row-class-name="rowClassName"
                       :data="tableData">
                <!--                <vxe-table-column type="radio" width="60" align="center" fixed="left"/>-->
                <vxe-table-column field="bcck0001" title="名称" align="left" fixed="left" />
                <vxe-table-column field="bcck0004" title="校验结果" align="left" width="100px"/>
                <vxe-table-column title="操作" align="center" fixed="right" width="100px">
                    <template #default="{ row }">
                        <Button type="success" size="small" style="margin-right: 5px" @click="handleView(row)">详情</Button>
                    </template>
                </vxe-table-column>
            </vxe-table>
            <Page :total="dataCount" :page-size="pageSize" show-total class="paging"
                  @on-change="handleTableChange" :current="pageNo"   ></Page>
            <div slot="footer" style="height:30px">
            </div>
        </Modal>
    </div>
</template>

<script>
    import {CommonMixin} from '@/views/common/js/CommonMixin'
    import '@/views/common/css/common.css';
    export default {
        mixins: [CommonMixin],
        data() {
            return {
                tableData:[],
                Loading: false,
                url: {
                    list: "/api/ac/subsistence/ss00015Service/getPageList",
                },
                formData: {
                },
                queryParam: {},
                visible:false,
                dataCount:0,
                pageSize:10,
                modalResult: false,
                title:"",
                titleResult:"校验结果",
            }
        },
        methods: {
          loadResult(month,bcck0005,bcck0006){
            this.modalResult = true;
            this.queryParam.bcck0005=bcck0005;
            this.queryParam.bcck0006=bcck0006;
            this.titleResult=month+"校验结果";
            this.loadData();
          },
          handleView (row) {
            let that=this;
            that.title="校验结果查看"
            let record=row;
            if (record.id) {
              that.visible = true
              that.showSubmit = false
              that.formData = Object.assign({}, record)
            } else {
              that.visible = false
            }
          },
          rowClassName ({ row }) {
            if ('fail' == row.bcck0004) {
              return 'row-red';
            }
          },
        },
        created() {
            this.loadData();
        },
    }
</script>
<style scoped>
    .paging {
        float: right;
        margin-top: 10px;
    }

    /deep/ .ivu-upload-list {
        display: none;
    }

    /deep/ .ivu-page {
        margin-top: 30px;
    }
</style>
